﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NPMonitor.Implementation;
using NPMonitor.DataModel.Report;

namespace NPMonitor.Web.Reports
{
    public partial class HttpActionList : BasePage
    {
        protected DateTime? BeginTime
        {
            get
            {
                string beginTime = Request["BeginTime"];

                if (!String.IsNullOrEmpty(beginTime))
                {
                    return beginTime.ToDateTimeByFormat();
                }

                return null;
            }
        }

        protected string ScenarioNo
        {
            get
            {
                return Request["ScenarioNo"];
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            BindReportActions();
        }

        protected void BindReportActions()
        {
            if (this.BeginTime != null)
            {
                ReportActions1.BeginTime = this.BeginTime.Value;
                ReportActions1.ScenarioNo = ScenarioNo;
                ReportActions1.BindData();
            }
        }

        public override string FunctionName
        {
            get { return FunctionEnum.HttpRequest.ToString(); }
        }
    }
}